<!--
 * @Author: Rachel 943701297@qq.com
 * @Date: 2022-09-04 11:49:25
 * @LastEditors: Rachel 943701297@qq.com
 * @LastEditTime: 2022-09-04 13:48:24
 * @FilePath: \JSCode\basic\正则表达式.html
 * @Description: 
 * 
 * Copyright (c) 2022 by Rachel 943701297@qq.com, All Rights Reserved. 
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>正则表达式测试</title>
  </head>
  <body>
    <script>
      let id = "511321200108095167";
      let id2 = "11010519491231002X";

      let regArea = /^[1-9]\d{5}/;
      let regYear = /19\d{2}|20([0-1][1-9]|10|20|21|22)/;
      let regMonth = /0[1-9]|1[0-2]/;
      let regDay = /[0-2][1-9]|10|20|30|31/;
      let regSeq = /\d{3}[0-9Xx]/;
      let idReg =
        /^[1-9]\d{5}(19\d{2}|20([0-1][1-9]|10|20|21|22))(0[1-9]|1[0-2])([0-2][1-9]|10|20|30|31)(\d{3}[0-9Xx])$/;
    </script>
  </body>
</html>
